﻿<%@ Page Language="C#" MasterPageFile="~/MainMaster.Master" AutoEventWireup="true" CodeBehind="AnalystAdd.aspx.cs" Inherits="Mang24k99.Web.Analyst.AnalystAdd" Title="新增分析师" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
   <script type="text/javascript">
        function AddOption()
        {
            var   obj=document.getElementById("ctl00_ContentPlaceHolder1_lstWord");   
            var   newOption=document.createElement("OPTION");   
            var   word=document.getElementById("ctl00_ContentPlaceHolder1_txtWord");
            newOption.text=word.value;
            newOption.value=word.value;
            obj.options.add(newOption);
        }
        function DelOption()
        {
            var remove=document.getElementById("ctl00_ContentPlaceHolder1_btnRemove");
            remove.click();
        }
        function TextClear(oEvent,defultText)
        {  
            //如果当前值为默认值，则清空 
            var obj=oEvent.srcElement ? oEvent.srcElement : oEvent.target;
            with(obj) 
            if(value==defultText) value="" 
        }
        function TextRes(oEvent,defultText)
        { 
             //如果值为空，则赋默认值
            var obj=oEvent.srcElement ? oEvent.srcElement : oEvent.target;
            with(obj) 
            if(value=="") value=defultText 
        }
        //预览图片
        function Preview()
        {
            var fileupload=document.getElementById("ctl00_ContentPlaceHolder1_btnUpload");
            fileupload.click();
        }
        //多文本框输入提示
        function textLimitCheck(obj,maxlength) 
        { 
            if (obj.value.length > maxlength) 
            { 
               alert(""+maxlength + " 个字限制,超出的将自动去除"); 
               obj.value = obj.value.substring(0, maxlength);
               obj.focus(); 
            } 
            /*回写span的值，当前填写文字的数量*/ 
            if(obj.id=="ctl00_ContentPlaceHolder1_txtOpinio")
            {
                messageCount1.innerText = obj.value.length;
            }
            if(obj.id=="ctl00_ContentPlaceHolder1_txtMottoWord")
            {
                messageCount2.innerText = obj.value.length;
            }
        } 
        //页面验证
        function Validate()
        {
            var name=document.getElementById("ctl00_ContentPlaceHolder1_txtName");
            var post=document.getElementById("ctl00_ContentPlaceHolder1_txtPost");
            var mottoword=document.getElementById("ctl00_ContentPlaceHolder1_txtMottoWord");
            var opinio=document.getElementById("ctl00_ContentPlaceHolder1_txtOpinio");
            if(name.value=="")
            {
                alert("请输入分析师姓名！");
                return false;
            }
             if(post.value=="")
            {
                alert("请输入职称！");
                return false;
            }
             if(opinio.value=="")
            {
                alert("请输入近期策略建议！");
                return false;
            }
             if(mottoword.value=="")
            {
                alert("请输入投资座右铭！");
                return false;
            }
        }
   </script>
    <table border="0" width="100%" height="34" align="center"
        background="../Images/bg1.jpg">
      <tr>
        <td width="40%" align="right"><a class="col_on" href="AnalystAdd.aspx">新增分析师</a></td>
        <td width="20%"></td>
        <td width="40%"><a class="col" href="AnalystList.aspx">更换或修改分析师</a></td>
      </tr>
    </table>
    
    <table border="1" cellpadding="0" cellspacing="0" width="98%" align="center" bordercolor="#BED6A6"
            style="border-collapse: collapse">

        <tr >
            <td class="tb_title1" style="width:20%">分析师所在机构：</td>
            <td class="tb_txt1">
                <asp:TextBox ID="TextBox1"  CssClass="forms" runat="server" Width="200px">
                </asp:TextBox></td>
        </tr>
        <tr>
            <td class="tb_title1">分析师姓名：</td>
            <td class="tb_txt1">
               <asp:TextBox ID="txtName"   CssClass="forms"  runat="server" MaxLength="30" Width="200px"></asp:TextBox>           
            </td>
        </tr>
        <tr>
            <td class="tb_title1">分析师照片：</td>
            <td class="tb_txt1">
                <table>
                    <tr>
                        <td ><asp:FileUpload ID="FileUpload1" runat="server" onchange="Preview()" /></td>
                        <td><asp:Button ID="btnUpload" runat="server" Text="预览" CssClass="hidden" onclick="btnUpload_Click"  /></td>
                        <td><asp:Image ID="imgPic" Width="80px" Height="100px" runat="server" /></td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td class="tb_title1">职称：</td>
            <td class="tb_txt1">
                <asp:TextBox ID="txtPost" CssClass="forms" Width="200px" MaxLength="15" 
                    Text="上限15个汉字" onfocus="TextClear(event,'上限15个汉字')" onblur="TextRes(event,'上限15个汉字')" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
            <td class="tb_title1">近期重点策略建议：</td>
            <td>
                <table width="100%">
                    <tr>
                        <td class="tb_txt1">
                            <asp:TextBox ID="txtOpinio" CssClass="forms"  runat="server" Width="90%" 
                                   Text="上限50个汉字" onfocus="TextClear(event,'上限50个汉字')" onblur="TextRes(event,'上限50个汉字')" 
                                   onkeyup="textLimitCheck(this,50)" onpaste="textLimitCheck(this,50)" TextMode="MultiLine"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                         <td>
                            <span style="color: #666666" class="tb_txt1">限50 个字符,已输入 </span>
                            <font color="#cc0000"> <span id="messageCount1"> 0</span></font>
                            <span style="color: #666666"> 个字</span>
                        </td>
                    </tr> 
                </table>
            </td>
        </tr>
        <tr>
            <td class="tb_title1">投资座右铭：</td>
            <td>
                 <table width="100%">
                    <tr>
                        <td class="tb_txt1">
                            <asp:TextBox ID="txtMottoWord"  CssClass="forms"  runat="server" Width="90%" 
                                   Text="上限50个汉字" onfocus="TextClear(event,'上限50个汉字')" onblur="TextRes(event,'上限50个汉字')"  
                                   onkeyup="textLimitCheck(this,50)" onpaste="textLimitCheck(this,50)" TextMode="MultiLine">
                            </asp:TextBox>
                       </td>
                    </tr>
                    <tr>
                         <td>
                            <span style="color: #666666" class="tb_txt1">限50 个字符,已输入 </span>
                            <font color="#cc0000"> <span id="messageCount2"> 0</span></font>
                            <span style="color: #666666"> 个字</span>
                        </td>
                    </tr> 
                </table>
            </td>
            
        </tr>
        <tr>
            <td  class="tb_title1">经历：</td>
            <td class="tb_txt1">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="5%">1</td>
                      <td width="95%">
                          <asp:TextBox ID="txtCurriculum1" CssClass="forms"  runat="server" MaxLength="25" 
                               Text="每则上限25个汉字" onfocus="TextClear(event,'每则上限25个汉字')" onblur="TextRes(event,'每则上限25个汉字')" Width="90%"></asp:TextBox>
                          </td>
                    </tr>
                    <tr>
                      <td>2</td>
                      <td><asp:TextBox ID="txtCurriculum2" CssClass="forms"  runat="server" MaxLength="25" Width="90%"></asp:TextBox></td>
                    </tr>
                    <tr>
                      <td>3</td>
                      <td><asp:TextBox ID="txtCurriculum3" CssClass="forms"  runat="server" MaxLength="25" Width="90%"></asp:TextBox></td>
                    </tr>
                    <tr>
                      <td>4</td>
                      <td><asp:TextBox ID="txtCurriculum4"  CssClass="forms"  runat="server" MaxLength="25" Width="90%"></asp:TextBox></td>
                    </tr>
                    <tr>
                      <td>5</td>
                      <td><asp:TextBox ID="txtCurriculum5" CssClass="forms"  runat="server" MaxLength="25" Width="90%"></asp:TextBox></td>
                    </tr>
                    <tr>
                      <td>6</td>
                      <td><asp:TextBox ID="txtCurriculum6" CssClass="forms" runat="server" MaxLength="25" Width="90%"></asp:TextBox></td>
                    </tr>
              </table>
          </td>
       </tr>
        <tr>
          <td  class="tb_title1">好译星对应栏目：</td>
          <td valign="top" >
                <div>
                    <asp:TextBox ID="txtWord" runat="server"  ></asp:TextBox>
                    <asp:Button ID="btnAdd" runat="server" Text="添加" onclick="btnAdd_Click"   /> 
                </div>
                <div>
                     <asp:ListBox ID="lstWord" runat="server" Height="200px" 
                            Width="100px" ondblclick="DelOption()"></asp:ListBox>
                    <asp:Button ID="btnRemove" runat="server" Text="移除" CssClass="hidden" onclick="btnRemove_Click" />      
                </div>
          </td>
        </tr>
        <tr>
          <td  class="tb_title1">是否显示在首页：</td>
          <td class="tb_txt1"> 
              <asp:RadioButton ID="rbtnTure" runat="server" Checked="True" 
                  GroupName="group" Text="是" TextAlign="Left" />
                  &nbsp;&nbsp;&nbsp;
              <asp:RadioButton ID="rbtnFalse"   GroupName="group" runat="server" Text="否" TextAlign="Left" />
          </td> 
        </tr>
    </table>
     <table border="0" cellpadding="0" cellspacing="0" width="50%" align="center">
        <tr>
            <td align="center">
                <asp:Button ID="btnSave" CssClass="form_btn" runat="server" Text="新增"  
                        OnClientClick=" return Validate()" onclick="btnSave_Click"  />
            </td>
            <td align="center">
                &nbsp;
            </td>
            <td align="center">
                <asp:Button ID="btnCancel" CssClass="form_btn" runat="server" Text="返回" 
                    onclick="btnCancel_Click" />
            </td>
        </tr>
    </table>
</asp:Content>
